Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add hooks #1218

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: Add hooks #1218

wants to merge 13 commits into from

Conversation

aawsome
Copy link
Member

@aawsome aawsome commented Aug 30, 2024

This PR adds run-before, run-after, run-failure and run-finally hooks for:

  • all commands in the [global] config profile section
  • the backup command specifically in the [backup] config profile section
  • specific backup sources in the [[backup.sources]] section

Note: This PR includes only calling the given commands. If there is the wish for supplying information to the commands (env variables or parameter substitution), this should be covered by a separate feature request/PR.

closes #902

Copy link
Contributor

@nardoor nardoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this feature deserves:

  • an integration test in some way
  • a page in the cargo book docs

src/commands/backup.rs Outdated Show resolved Hide resolved
src/commands/backup.rs Outdated Show resolved Hide resolved
src/commands/backup.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
@aawsome aawsome changed the title feat: Add run-before and run-after hooks feat: Add hooks Sep 1, 2024
src/config.rs Outdated Show resolved Hide resolved
Comment on lines +44 to +45
rustic_backend = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] }
rustic_core = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to release the changes first without re-introducing git dependencies again, changing them back later. Now that releasing should be just merging the release pr.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wait for a release of rustic_core, we'll pile up PRs in rustic which depend on these things but cannot be merged. We won't have the features in the nightly builds and will not get any feedback until we release a rustic release.

As many changes in rustic are changes in rustic_core, I see no alternative than using a git dependency here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I understand. Do you think it would be viable to up the release cadence for rustic_core and say we do at least one release in a week with things that have been merged, even if small one's? It would be just a click away, we could release another rustic_core version today, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Per source hooks in the config file
4 participants